﻿#region 참조 네임스페이스

using System;
using System.Net.Sockets;
using System.ComponentModel;

#endregion

namespace Skying.Net.Sockets
{
	public class SocketErrorEventArgs
	{
		#region 프로퍼티

		public Exception Exception
		{
			get;
			private set;
		}

		public bool IsSocketError
		{
			get
			{
				return this.Exception is SocketException;
			}
		}

		public SocketException SocketException
		{
			get
			{
				if (this.IsSocketError) return null;

				return this.Exception as SocketException;
			}
		}

		#endregion

		#region 생성자/소멸자

		public SocketErrorEventArgs(Exception exception)
		{
			this.Exception = exception;
		}

		#endregion
	}
}